package com.s4j.core.manager.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name="SYS_USER")
public class SysUser {

	private Long userId;
	
	private String userName;
	
	private String password;
	
	private SysPerson person;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	@Column(length=50, nullable=false, unique=true)
	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Column(length=50, nullable=false)
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@OneToOne  
    @JoinColumn(name="personId",insertable=true,unique=true)
	public SysPerson getPerson() {
		return person;
	}

	public void setPerson(SysPerson person) {
		this.person = person;
	}
}
